//
//  SelectedPasswordTypeViewController.m
//  1gene
//
//  Created by 1jiyin on 16/4/6.
//  Copyright © 2016年 1jiyin. All rights reserved.
//

#import "SelectedPasswordTypeViewController.h"

@interface SelectedPasswordTypeViewController ()

@end

@implementation SelectedPasswordTypeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor=[UIColor whiteColor];
    [self createNavigation];
    [self createUI];
    // Do any additional setup after loading the view.
}
-(void)createUI
{
    //修改登录密码
    UIButton *changeBtn=[UIButton buttonWithType:UIButtonTypeCustom];
    changeBtn.tag=1;
    changeBtn.frame=CGRectMake((self.view.frame.size.width-160)/2.0, 150, 160, 35);
    [changeBtn setTitle:@"忘记登录密码" forState:UIControlStateNormal];
    [changeBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    changeBtn.titleLabel.font=[UIFont systemFontOfSize:17];
    changeBtn.backgroundColor=[UIColor colorWithRed:87/255.0 green:187/255.0 blue:215/255.0 alpha:1];
    changeBtn.layer.borderColor=[UIColor colorWithRed:87/255.0 green:187/255.0 blue:215/255.0 alpha:1].CGColor;
    changeBtn.layer.borderWidth=2.0;
    changeBtn.layer.cornerRadius=5.0;
    [changeBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:changeBtn];
    
    //修改健康档案密码
    UIButton *changeBtn1=[UIButton buttonWithType:UIButtonTypeCustom];
    changeBtn1.tag=2;
    changeBtn1.frame=CGRectMake((self.view.frame.size.width-160)/2.0, 150+35+20, 160, 35);
    [changeBtn1 setTitle:@"忘记健康档案密码" forState:UIControlStateNormal];
    [changeBtn1 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    changeBtn1.titleLabel.font=[UIFont systemFontOfSize:17];
    changeBtn1.backgroundColor=[UIColor colorWithRed:87/255.0 green:187/255.0 blue:215/255.0 alpha:1];
    changeBtn1.layer.borderColor=[UIColor colorWithRed:87/255.0 green:187/255.0 blue:215/255.0 alpha:1].CGColor;
    changeBtn1.layer.borderWidth=2.0;
    changeBtn1.layer.cornerRadius=5.0;
    [changeBtn1 addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:changeBtn1];
    

}
-(void)btnClick:(UIButton *)sender
{
    ForgotPasswordViewController *vc=[[ForgotPasswordViewController alloc]init];
    vc.passwordType=sender.tag;
    [self.navigationController pushViewController:vc animated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)createNavigation
{
    self.navigationController.navigationBar.barTintColor=[UIColor colorWithRed:84/255.0 green:199/255.0 blue:222/255.0 alpha:1];
    //返回
    UIButton *leftBtn=[UIButton buttonWithType:UIButtonTypeCustom];
    leftBtn.frame=CGRectMake(0, 0, 25, 25);
    [leftBtn setBackgroundImage:[UIImage imageNamed:@"left_back"] forState:UIControlStateNormal];
    [leftBtn addTarget:self action:@selector(leftBtnClick:) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.leftBarButtonItem=[[UIBarButtonItem alloc]initWithCustomView:leftBtn];
    
    //标题
    UILabel *title=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 44)];
    title.text=@"忘记密码";
    title.font=[UIFont systemFontOfSize:22];
    title.textAlignment=NSTextAlignmentCenter;
    title.textColor=[UIColor whiteColor];
    self.navigationItem.titleView=title;
}
//返回上一页
-(void)leftBtnClick:(UIButton *)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
